package Buffer;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

public class GameDemo {
    public static void main(String[] args) throws IOException {

        Properties prop = new Properties();
        FileReader fr = new FileReader("funCode\\game.txt");

        prop.load(fr);
        fr.close();
        String s = prop.getProperty("count");
        int i = Integer.parseInt(s);
        if (i >= 3) {
            System.out.println("you must pay someMoney");
        } else {
            GuessGame.start();
            i++;
            prop.setProperty("count", String.valueOf(i));
            FileWriter fw = new FileWriter("funCode\\game.txt");
            prop.store(fw,"");
            fw.close();
        }
    }
}
